<?php
session_start();
function __autoload($className)
	{
    	require_once('../class/' . $className . '.class.php');
	}
if(session::is_manager()==TRUE)
{
$q = '';
if (isset($_GET['q'])) {
    $q = strtolower($_GET['q']);
   $q=rtrim(trim($q));
   $condition = "username LIKE '" .$q. "%' or userid LIKE '" .$q. "%'";
		$classCode =database::LimitQuery('userinfo',array(
		'select' => 'username,userid',
		'condition' => $condition
		));
		
		foreach($classCode as $Result)
		{
			
			$username=$Result['username']."-".$Result['userid'];
			$titles[$username]=$username;
			
		}
		
}
if (!$q) {
    return;
}
if(!empty($titles))
{

foreach ($titles as $key => $value) {
	if (strpos(strtolower($key), $q) !== false) {
		echo "$value\n";
	}
}
}
}
?>